home *** CD-ROM | disk | FTP | other *** search
- Path: damage.usa1.net!news
- From: Kin Chan <firstian@usa1.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Random numbers
- Date: Thu, 11 Jan 1996 23:27:51 -0500
- Organization: USAinternet, Inc.
- Message-ID: <30F5E347.5CCD@usa1.com>
- References: <4cul2d$gi@news.ran.es>
- NNTP-Posting-Host: wmn1-158.usa1.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b4 (Macintosh; I; PPC)
-
- In order to know the period of the rand() you need to know the
- numbers chosen to implement the linear congruential method.
- Typically, the rand() from compilers are pretty bad if you want
- about a 1 million random numbers. For a random number generator that
- has a short period, even if you do not deplete all the numbers it
- generates, the sequence of numbers that appear may have some special
- correlation. Probably the best bet is to check out Numerical Recipes
- for C, 2nd Ed. (There is a bug in one of the random number code in
- the 1st Ed).
-